﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Code.Models
{
    public enum SchemeState
    {
        /// <summary>
        /// 系统撤销
        /// </summary>
        SysCancel=-3,
        /// <summary>
        /// 过期撤销
        /// </summary>
        TimeOutCancel = -2,
        /// <summary>
        /// 用户撤销
        /// </summary>
        UserCancel = -1,
        /// <summary>
        /// 正常
        /// </summary>
        Normal = 0,
        /// <summary>
        /// 已出票
        /// </summary>
        OutBill = 1,
        /// <summary>
        /// 已开奖
        /// </summary>
        Opened = 2,
    }


    public static class SchemeStateEx
    {
        public static string GetName(this SchemeState state)
        {
            switch (state)
            {
                case SchemeState.SysCancel:
                    return "系统撤销";
                case SchemeState.TimeOutCancel:
                    return "过期撤销";
                case SchemeState.UserCancel:
                    return "用户撤销";
                case SchemeState.Normal:
                    return "未出票";
                case SchemeState.OutBill:
                    return "已出票";
                case SchemeState.Opened:
                    return "已开奖";
                default:
                    throw new ArgumentOutOfRangeException("state");
            }
        }
    }
}
